#!/bin/bash
set -e

msg() {
 echo "$@"
}

msg2() {
 echo "$@"
}

source PKGBUILD
set -x
for pn in "${pkgname[@]}"; do
  #FIXME: use IFS and find with \0  to ensure dirs with spaces are good!
  for dir in `find "./makepkg_pacman/${pn}/src/" -maxdepth 1 -type d`; do
    #cd -- "${dir}" &&
    time make -C "${dir}" clean || true
  done
done

